<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <title>管理系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1, maximum-scale=1"
    />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <link rel="stylesheet" href="{{url_for('static',filename='amis/sdk.css')}}" />
    <script src="{{url_for('static',filename='amis/sdk.js')}}"></script>
    <script type="text/javascript">
    	// 来个闭包，免得污染全局变量。
    	(function(require) {

    	// 初始化边栏展开收起功能。
    	function initAsideToggle($) {
    	    const layout = $('.a-Layout');

    	    $('#aside-toggler').on('click', function() {
    	        const $i = $('>i', this); 
    	        const isFolded = $i.hasClass('fa-indent');

    	        if (isFolded) {
    	            layout.removeClass('a-Layout--folded');
    	            $i.removeClass('fa-indent').addClass('fa-dedent');
    	        } else {
    	            layout.addClass('a-Layout--folded');
    	            $i.removeClass('fa-dedent').addClass('fa-indent');
    	        }
    	    });
    	}
    	// 初始化导航展开效果。
    	function initNav($) {
    	    $('.a-AsideNav-itemArrow').click(function() {
    	        const $item = $(this).closest('.a-AsideNav-item');
    	        const isOpen = $item.hasClass('is-open');

    	        if (isOpen) {
    	            $item.removeClass('is-open');
    	        } else {
    	            $item.addClass('is-open');
    	        }
    	        return false;
    	    });
    	}

    	// 也可以通过其他方式加载 jQuery
    	require(["jquery"], function($) {
    	    initAsideToggle($);
    	    initNav($);
    	});
    	})(amisRequire);
    </script>
    <!-- 这个 js 主要包含一些简单导航边栏点击效果。 -->
    <style type="text/css">
    	html, body {
    	    position: relative;
    	    width: 100%;
    	    height: 100%;
    	    margin: 0;
    	    padding: 0;
    	}

    	.app-wrapper {
    	    position: relative;
    	    width: 100%;
    	    height: 100%;
    	}

    	.navbar-nav .navbar-btn {
    	    padding: 8px;
    	}
      {% block css %}
      {% endblock css %}
    </style>
  </head>
  <!-- 这个一定要记得加，否则导航部分没样式 -->
  <body class="amis-scope"> 
    <div class="a-Layout a-Layout--withAside a-Layout--headerFixed a-Layout--asideFixed a-Layout--noFooter"> 
     <div class="a-Layout-header"> 
      <div> 
       <div class="a-Layout-brandBar"> 
        <button class="pull-right visible-xs"> <i class="glyphicon glyphicon-align-justify"></i> </button> 
        <div class="a-Layout-brand"> 
         <i class="fa fa-paw"></i>
         <span class="hidden-folded m-l-sm">管理系统</span> 
        </div> 
       </div> 
       <div class="a-Layout-headerBar"> 
        <div class="nav navbar-nav hidden-xs"> 
         <button id="aside-toggler" type="button" class="a-Button a-Button--link a-Button--iconOnly navbar-btn"> <i class="fa fa-dedent"></i> </button> 
        </div> 
        <div class="hidden-xs p-t-sm pull-right"> 
         <div class="dropdown"> 
         <!--  <span><span class="pull-right m-b-n-sm m-l-sm"> <span> <i class="iconfont icon-admin"></i> </span> <i class="on md b-white bottom"></i> </span> <span class="hidden-sm hidden-md">
            admin</span> <b class="caret"></b> </span>  -->

         </div> 
        </div> 
       </div> 
      </div> 
     </div> 
     <div class="a-Layout-aside"> 
      <div class="a-Layout-asideWrap"> 
       <div id="asideInner" class="a-Layout-asideInner"> 
        <!--导航部分--> 
        <nav class="a-AsideNav"> 
         <ul class="a-AsideNav-list"> 
          <li class="a-AsideNav-label"><span>导航</span></li> 
          <li class="a-AsideNav-item {% if request.path == '/index' %}is-open is-active{% endif %}">
            <a href="/index">
              <i class="a-AsideNav-itemIcon glyphicon glyphicon-home"></i>
              <span class="a-AsideNav-itemLabel">首页</span>
            </a> 
          <li class="a-AsideNav-item {% if '/account' in request.path %}is-open{% endif %}">
            <a>
              <span class="a-AsideNav-itemArrow"></span>
              <i class="a-AsideNav-itemIcon glyphicon glyphicon-user"></i>
              <span class="a-AsideNav-itemLabel">个人相关</span>
            </a>
            <ul class="a-AsideNav-subList"> 
              <li class="a-AsideNav-item {% if '/editpwd' in request.path %}is-active{% endif %}"> <a href="/account/editpwd"> <span class="a-AsideNav-itemLabel">修改密码</span></a> </li> 
              <li class="a-AsideNav-item"> <a href="/account/logout"> <span class="a-AsideNav-itemLabel">退出登录</span></a> </li> 
            </ul>
          </li>
          {% if session['level'] == 1 %}
            <li class="a-AsideNav-item {% if request.path == '/users' %}is-open is-active{% endif %}">
              <a href="/users">
                <i class="a-AsideNav-itemIcon glyphicon glyphicon-list-alt"></i>
                <span class="a-AsideNav-itemLabel">教师管理</span>
              </a> 
             <div class="a-AsideNav-tooltip">
              用户管理
             </div>
            </li> 
            <li class="a-AsideNav-item {% if request.path == '/myclass' %}is-open is-active{% endif %}">
              <a href="/myclass">
                <i class="a-AsideNav-itemIcon glyphicon glyphicon-glass"></i>
                <span class="a-AsideNav-itemLabel">班级管理</span>
              </a> 
             <div class="a-AsideNav-tooltip">
              用户管理
             </div>
            </li> 

          {% endif %}
          <li class="a-AsideNav-item {% if request.path == '/student' %}is-open is-active{% endif %}">
              <a href="/student">
                <i class="a-AsideNav-itemIcon fa fa-users"></i>
                <span class="a-AsideNav-itemLabel">学生信息</span>
              </a> 
             <div class="a-AsideNav-tooltip">
              学生信息
             </div>
          </li>
          <li class="a-AsideNav-item {% if request.path == '/score' %}is-open is-active{% endif %}">
              <a href="/score">
                <i class="a-AsideNav-itemIcon fa fa-hashtag"></i>
                <span class="a-AsideNav-itemLabel">考试得分</span>
              </a> 
             <div class="a-AsideNav-tooltip">
              考试得分
             </div>
          </li>

         </ul> 
        </nav> 
        <!--导航结束--> 
       </div> 
      </div> 
     </div> 
     <div class="a-Layout-content" role="main"> 
      <div id="main" class="a-Layout-body"></div> 
     </div> 
    </div> 
    <script type="text/javascript">
        {% block content %}
        {% endblock content %}
       
      </script> 
   </body>
</html>
